<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>IE9 axios cors 测试</title>
    <script src="https://rsvpjs-builds.s3.amazonaws.com/rsvp-latest.min.js"></script>
    <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
    <!-- <script src="https://unpkg.com/babel-polyfill@6.26.0"></script> -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js"></script>
</head>
<body>
    <button id="test" onclick="test()">发送请求</button>
    <pre id="res">

    </pre>

    <script>
            // $.getJSON('http://jsonmoon.jsapp.us/').done(function(data) {
            // console.log(data.name.first);
            // });
            // // POST
            // $.ajax({
            // url: 'http://frozen-woodland-5503.herokuapp.com/cors.json',
            // data: 'this is data being posted to the server',
            // contentType: 'text/plain',
            // type: 'POST',
            // dataType: 'json'
            // }).done(function(data) {
            // console.log(data.name.last);
            // });
            function test(){
                console.log("test");
                $.getJSON('https://easy-mock.com/mock/595b562c9adc231f3570a42c/api/table/list')
                .then(function (response) {
                    console.log(response);
                    document.getElementById("res").innerHTML = "响应结果:"+ JSON.stringify(response.data);
                })
            }
        // .catch(function (error) {
        //     console.log(error);
        // });
    </script>

</body>

</html>